import Vue from 'vue'
//路由相关
//载入vue-router
import VRouter from 'vue-router'
//使用
Vue.use(VRouter)

export default new VRouter({
    routes:[
        {path:'/',redirect:'/home'},
        {
            path:'/mint',redirect:'/mint/toast',
            component:resolve=>{require(['@/page/mint/mintPage'],resolve)},
            children:[
                {path:'toast',component:resolve=>{require(['@/page/mint/toast'],resolve)}},
                {path:'lazyload',component:resolve=>{require(['@/page/mint/lazyload'],resolve)}},
                {path:'swipper',component:resolve=>{require(['@/page/mint/swipper'],resolve)}},
                {path:'cellSwipper',component:resolve=>{require(['@/page/mint/cellSwipper'],resolve)}}
            ]
        },
        {path:'/home',component:resolve=>{require(['@/page/home'],resolve)}},
        {path:'/lifecircle',component:resolve=>{require(['@/page/lifecircle'],resolve)}},
        {path:'/action',component:resolve=>{require(['@/page/action'],resolve)}},
        {path:'/cross',component:resolve=>{require(['@/page/cross'],resolve)}},
        {
            path:'/class',redirect:'/class/class',
            component:resolve=>{require(['@/page/class/classPage'],resolve)},
            children:[
                {path:'class',component:resolve=>{require(['@/page/class/class'],resolve)}},
                {path:'style',component:resolve=>{require(['@/page/class/style'],resolve)}}
            ]
        },
        {
            path:'/com',redirect:'/com/base',
            component:resolve=>{require(['@/page/com/comPage'],resolve)},
            children:[
                {path:'base',component:resolve=>{require(['@/page/com/base'],resolve)}},
                {path:'son',component:resolve=>{require(['@/page/com/son'],resolve)}},
                {path:'toParent',component:resolve=>{require(['@/page/com/toParent'],resolve)}},
                {path:'is',component:resolve=>{require(['@/page/com/is'],resolve)}},
                {path:'slot',component:resolve=>{require(['@/page/com/slot'],resolve)}},
                {path:'slotName',component:resolve=>{require(['@/page/com/slotName'],resolve)}},
                {path:'starPage',component:resolve=>{require(['@/page/com/starPage'],resolve)}}
            ]
        },
        {
            path:'/router',
            component:resolve=>{require(['@/page/router/route'],resolve)},
            children:[
                {name:'par',path:'par',component:resolve=>{require(['@/page/router/params.vue'],resolve)}},
                {path:'child',component:resolve=>{require(['@/page/router/child.vue'],resolve)}}
            ]
        }
    ]
})
